class bankacount:
    def __init__(self,account_number,balance):
        """银行账户初始化

        Args:
            account_number 银行卡号
            balance (_type_): 余额
        """
        self.account_number = account_number
        self.__balance = balance
        
    def deposit(self,amount): #存款
        self.__balance+=amount
        print(self.__balance)
        
    def withdraw(self,amount):
        if 0<amount<=self.__balance:
            self.__balance-=amount
            self.__pay_interest()
            return amount
        else:
            print("提现失败")
            return 0
    def __pay_interest(self):
        self.__balance-=5
        
    def get_banlance(self):
        return self.__balance
       
    def __str__(self):
        return "账户卡号：{}  账户余额:{}".format(self.account_number,self.__balance)
    
    
    
#主函数
account1 = bankacount(123545,1000)
print(account1.__balance)  #不可访问
print(account1)
account1.deposit(200)
account1.withdraw(10000)

"""加双下划线(__)私有化,类外部不可直接访问"""
"""单下划线(_)可强制访问，但不建议"""